#ifndef PLAYSTATE_H
#define PLAYSTATE_H

#include <ouden.h>

/*
template <class T>
class CCommand
{
	
public:
	
	void send();
	
protected:
	
	virtual void sendActual(CCommandReceiver* pReceiver) = 0;
	
};
*/

class CPlayState : public ouden::CGameState, public ouden::CSingleton<CPlayState>
{
public:
		
		//Events called by a game manager
		virtual void onEnter();
		virtual void onExit();
		virtual void onPause() 						{}
		virtual void onResume() 					{}
		
		virtual bool onTick(ouden::CGameTimer* pTimer);
		virtual bool onFrameStart(ouden::CGameTimer* pTimer);
		
		virtual bool frameEnded();
		
		virtual void onUnBufInput(ouden::IInputDevice* pInput);
		virtual void onKeyDown(ouden::KeyCode iKey);
		virtual void onKeyUp(ouden::KeyCode iKey) 		{}
		virtual void onKeyPress(ouden::KeyCode iKey) 	{}
		virtual void onMouseMove(ouden::Vector vPos, ouden::MouseButton iButtonState);
		virtual void onMouseButtonDown(ouden::Vector vPos, ouden::MouseButton iButton) 	{}
		virtual void onMouseButtonUp(ouden::Vector vPos, ouden::MouseButton iButton) 	{}
		virtual void onMouseButtonPress(ouden::Vector vPos, ouden::MouseButton iButton) 	{}
		
		CPlayState();
		~CPlayState();
		
protected:
	
private:
	
	void createScene();
	
	//Should we exit the game next frame?
	bool m_bExit;
	
	Ogre::Plane m_plPlayingPlane;
	
	Ogre::SceneNode* m_pCursorNode;
	Ogre::Rectangle2D* m_pCursorRect;
	
};

#endif // PLAYSTATE_H
